﻿//损溢报告操作
var columns =
            [
                 { display: 'Key', name: 'ID', type: 'text', hide: 1 },
                  { display: 'ProfitAndLossBillID', name: 'ProfitAndLossBillID', type: 'text', hide: 1 },
                  { display: 'StockID', name: 'StockID', type: 'text', hide: 1 },
                 { display: '产品类别', name: 'TypeName', mintWidth: 80, width: 120, type: 'text' },
                   { display: '产品名称', name: 'ProductName', mintWidth: 80, width: 160, type: 'text' },
                   { display: '产品编码', name: 'ProductCode', mintWidth: 80, width: 100, type: 'text' },
                    { display: '产品规格', name: 'ProductStandard', mintWidth: 80, width: 200, type: 'text' },
                { display: '盈亏数量', name: 'Amount', mintWidth: 100, width: 140, type: 'int' },
                { display: '备注', name: 'Remarks', mintWidth: 80, width: 140 }
             ];

var manager;
//init controls
$(document).ready(function () {
    intiToobar();
    initligerGrid();
});

function initligerGrid() {
    manager = null;
    manager = $("#ProfitAndLossItemsGrid").ligerGrid({
        columns: columns,
        //  title: '损溢报告细',//不能要标题，修改的BUG，不在ligerui.min.js文件中，所以这个BUG还是存在
        showTitle: false,
        width: '100%',
        enabledSort: true,
        enabledEdit: true,
        checkbox: false,
        rownumbers: true,
        url: "../ProfitAndLoss/GetJsonOfBillDetails?billId=" + $("#Id").val() + "&rand=" + Math.random()
    });
}

function intiToobar() {
    $("#toptoolbar").ligerToolBar({ items: [
                { text: '损溢报告信息管理', icon: 'add' }
            ]
    });
}
